package com.cyan.learn.pattern.responsibility;

public class ResponsibilityText {
    public static void main(String[] args) {
        LeaveRequest request = new LeaveRequest("小红", 88, "请假去医院");

        GroupHandler groupHandler = new GroupHandler();
        ManagerHandler managerHandler = new ManagerHandler();
        GenericHandler genericHandler = new GenericHandler();
        
        // 创建责任链
        groupHandler.setNextHandler(managerHandler);
        managerHandler.setNextHandler(genericHandler);
        
        groupHandler.submit(request);
    }
}
